//
//  UIView+Extension.swift
//  elarc01
//
//  Created by elarc on 16/3/21.
//  Copyright © 2016年 elarc. All rights reserved.
//

import UIKit

// 对UIView的扩展
extension UIView{
    var x:CGFloat{
        get{
            return frame.origin.x
        }
        set{
            var f = frame
            f.origin.x = newValue
            frame = f
        }
    }
    var y:CGFloat{
        get{
            return frame.origin.y
        }
        set{
            var f = frame
            f.origin.y = newValue
            frame = f
        }
    }
    var width:CGFloat{
        get{
            return frame.size.width
        }
        set{
            var f = frame
            f.size.width = newValue
            frame = f
        }
    }
    var height:CGFloat{
        get{
            return frame.size.height
        }
        set{
            var f = frame
            f.size.height = newValue
            frame = f
        }
    }
}